<?php
namespace Illuminate\Auth;

trait Authenticatable {
    protected $rememberTokenName = 'remember_token';

    public function getAuthIdentifierName() { // 获取登录标识字段
        return $this->getKeyName();
    }
    public function getAuthIdentifier() { // 获取登录标识
        return $this->{$this->getAuthIdentifierName()};
    }
    public function getAuthPassword() { // 获取登录密码
        return $this->password;
    }

    public function getRememberToken() {
        if ( ! empty($this->getRememberTokenName()) ) return (string) $this->{$this->getRememberTokenName()};
    }
    public function setRememberToken($value) {
        if ( ! empty($this->getRememberTokenName()) ) $this->{$this->getRememberTokenName()} = $value;
    }
    public function getRememberTokenName() {
        return $this->rememberTokenName;
    }
}
